From 01120b223aba0af46d482ac679c467d39d9cad7d Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Fri, 29 Apr 2016 16:11:15 +0100 Subject: [PATCH] blktap2: initialise buf in vhd_util_check_footer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Gcc complains: vhd-util-check.c: In function ‘vhd_util_check_footer’: vhd-util-check.c:413:2: error: ‘buf’ may be used uninitialized in this function [-Werror=maybe-uninitialized] memcpy(&backup, buf, sizeof(backup)); In fact buf is initialised a few lines above. Signed-off-by: Wei Liu Reviewed-by: Doug Goldstein Release-acked-by: Wei Liu --- tools/blktap2/vhd/lib/vhd-util-check.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/blktap2/vhd/lib/vhd-util-check.c b/tools/blktap2/vhd/lib/vhd-util-check.c index af07426d5b..40565ac233 100644 --- a/tools/blktap2/vhd/lib/vhd-util-check.c +++ b/tools/blktap2/vhd/lib/vhd-util-check.c @@ -335,7 +335,7 @@ vhd_util_check_footer(int fd, vhd_footer_t *footer, int ignore) { size_t size; int err, opened; - char *msg, *buf; + char *msg, *buf = NULL; off_t eof, off; vhd_footer_t primary, backup; -- 2.30.2